#ifndef __FUNCTION_INTERFACE_H
#define __FUNCTION_INTERFACE_H
#include <stdint.h>
#include "utils.h"
#include "fpga_addr_define.h"


typedef enum
{
    FUNCINF_ERR_NONE    = 0,
    FUNCINF_ERR_PARAM   = 1,
    FUNCINF_ERR_ENUM    = 2,
    FUNCINF_ERR_READ    = 3,
    FUNCINF_ERR_WRITE   = 4,
    FUNCINF_ERR_CONVERT = 5,
} funcInfErr_t;


#define FUNCINF_OPERATOR_TABLE \
    X_MACRO(INIT,                  0) /* 初始化 */ \
    X_MACRO(UPPER,                 1) /* 上位机 */ \
    X_MACRO(EMS,                   2) /* EMS */ \
    X_MACRO(LC,                    3) /* LC */ \
    X_MACRO(BMS,                   4) /* BMS */ \
    X_MACRO(DCDC,                  5) /* DCDC */ \
    X_MACRO(HMI,                   6) /* 触摸屏 */ \
    X_MACRO(RATED_LIMIT,           7) /* 限额 */ \
    X_MACRO(PULSE_OPERATE,         8) /* 脉冲操作 */ \
    X_MACRO(TEMP_SAMPLE,           9) /* 温度采样 */ \
    X_MACRO(OVER_TEMP,             10) /* 过温 */ \
    X_MACRO(OVER_LOAD,             11) /* 过载 */ \
    X_MACRO(OVER_UNDER_VOL,        12) /* 过欠压 */ \
    X_MACRO(OVER_UNDER_FREQ,       13) /* 过欠频 */ \
    X_MACRO(1547,                  14) /* 1547 */ \
    X_MACRO(TIME_PERIOD,           15) /* 时间段 */ \

typedef enum
{
#define X_MACRO(a, b) FUNCINF_OPERATOR_##a = b,
    FUNCINF_OPERATOR_TABLE
#undef X_MACRO    
} funcInfOperator_t;


#define FUNCINF_VOL_TYPE_TABLE \
    X_MACRO(FUNCINF_VOL_TYPE_PHASE_A, 0) \
    X_MACRO(FUNCINF_VOL_TYPE_PHASE_B, 1) \
    X_MACRO(FUNCINF_VOL_TYPE_PHASE_C, 2) \
    X_MACRO(FUNCINF_VOL_TYPE_BUS,     3) \
    X_MACRO(FUNCINF_VOL_TYPE_DC,      4) \
    X_MACRO(FUNCINF_VOL_TYPE_BAT,     5) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_VOL_TYPE_TABLE
#undef X_MACRO    
} funcInfVolType_t;


#define FUNCINF_CUR_TYPE_TABLE \
    X_MACRO(FUNCINF_CUR_TYPE_PHASE_A, 0) \
    X_MACRO(FUNCINF_CUR_TYPE_PHASE_B, 1) \
    X_MACRO(FUNCINF_CUR_TYPE_PHASE_C, 2) \
    X_MACRO(FUNCINF_CUR_TYPE_BUS,     3) \
    X_MACRO(FUNCINF_CUR_TYPE_DC,      4) \
    X_MACRO(FUNCINF_CUR_TYPE_BAT,     5) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_CUR_TYPE_TABLE
#undef X_MACRO  
} funcInfCurType_t;


#define FUNCINF_PWR_TYPE_TABLE \
	X_MACRO(FUNCINF_PWR_TYPE_ACT,      0) \
	X_MACRO(FUNCINF_PWR_TYPE_REACT,    1) \
	X_MACRO(FUNCINF_PWR_TYPE_APPARENT, 2) \
	X_MACRO(FUNCINF_PWR_TYPE_BUS,      3) \
	X_MACRO(FUNCINF_PWR_TYPE_DC,       4) \
	X_MACRO(FUNCINF_PWR_TYPE_BAT,      5) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_PWR_TYPE_TABLE
#undef X_MACRO  
} funcInfPwrType_t;


#define FUNCINF_LMT_TYPE_TABLE \
	X_MACRO(FUNCINF_LMT_TYPE_AC_CUR,          0) \
	X_MACRO(FUNCINF_LMT_TYPE_AC_PWR_CHRG,     1) \
	X_MACRO(FUNCINF_LMT_TYPE_AC_PWR_DISC,     2) \
	X_MACRO(FUNCINF_LMT_TYPE_DC_CUR_CHRG,     3) \
	X_MACRO(FUNCINF_LMT_TYPE_DC_CUR_DISC,     4) \
	X_MACRO(FUNCINF_LMT_TYPE_DC_PWR_CHRG,     5) \
	X_MACRO(FUNCINF_LMT_TYPE_DC_PWR_DISC,     6) \
	X_MACRO(FUNCINF_LMT_TYPE_DC1_DC_CUR_CHRG, 7) \
	X_MACRO(FUNCINF_LMT_TYPE_DC1_DC_CUR_DISC, 8) \
	X_MACRO(FUNCINF_LMT_TYPE_DC1_DC_PWR_CHRG, 9) \
	X_MACRO(FUNCINF_LMT_TYPE_DC1_DC_PWR_DISC, 10) \
	X_MACRO(FUNCINF_LMT_TYPE_DC2_DC_CUR_CHRG, 11) \
	X_MACRO(FUNCINF_LMT_TYPE_DC2_DC_CUR_DISC, 12) \
	X_MACRO(FUNCINF_LMT_TYPE_DC2_DC_PWR_CHRG, 13) \
	X_MACRO(FUNCINF_LMT_TYPE_DC2_DC_PWR_DISC, 14) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_LMT_TYPE_TABLE
#undef X_MACRO  
} funcInfLmtType_t;


#define FUNCINF_REG_IDX_TABLE \
	X_MACRO(FUNCINF_REG_IDX_0,  0) \
	X_MACRO(FUNCINF_REG_IDX_1,  1) \
	X_MACRO(FUNCINF_REG_IDX_2,  2) \
	X_MACRO(FUNCINF_REG_IDX_3,  3) \
	X_MACRO(FUNCINF_REG_IDX_4,  4) \
	X_MACRO(FUNCINF_REG_IDX_5,  5) \
	X_MACRO(FUNCINF_REG_IDX_6,  6) \
	X_MACRO(FUNCINF_REG_IDX_7,  7) \
	X_MACRO(FUNCINF_REG_IDX_8,  8) \
	X_MACRO(FUNCINF_REG_IDX_9,  9) \
	X_MACRO(FUNCINF_REG_IDX_10, 10) \
	X_MACRO(FUNCINF_REG_IDX_11, 11) \
	X_MACRO(FUNCINF_REG_IDX_12, 12) \
	X_MACRO(FUNCINF_REG_IDX_13, 13) \
	X_MACRO(FUNCINF_REG_IDX_14, 14) \
	X_MACRO(FUNCINF_REG_IDX_15, 15) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_REG_IDX_TABLE
#undef X_MACRO  
} funcInfRegIdx_t;


#define FUNCINF_FSM_TYPE_TABLE \
	X_MACRO(FUNCINF_FSM_TYPE_THIS_TIME,   0) \
	X_MACRO(FUNCINF_FSM_TYPE_1_LAST_TIME, 1) \
	X_MACRO(FUNCINF_FSM_TYPE_2_LAST_TIME, 2) \
	X_MACRO(FUNCINF_FSM_TYPE_3_LAST_TIME, 3) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_FSM_TYPE_TABLE
#undef X_MACRO  
} funcInfFsmType_t;


#define FUNCINF_CMD_IDX_TABLE \
	X_MACRO(FUNCINF_CMD_IDX_0, 0) \
	X_MACRO(FUNCINF_CMD_IDX_1, 1) \
	X_MACRO(FUNCINF_CMD_IDX_2, 2) \
	X_MACRO(FUNCINF_CMD_IDX_3, 3) \
	X_MACRO(FUNCINF_CMD_IDX_4, 4) \
	X_MACRO(FUNCINF_CMD_IDX_5, 5) \
	X_MACRO(FUNCINF_CMD_IDX_6, 6) \
	X_MACRO(FUNCINF_CMD_IDX_7, 7) \
	X_MACRO(FUNCINF_CMD_IDX_8, 8) \
	X_MACRO(FUNCINF_CMD_IDX_9, 9) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_CMD_IDX_TABLE
#undef X_MACRO  
} funcInfCmdIdx_t;


#define FUNCINF_BIT_IDX_TABLE \
	X_MACRO(FUNCINF_BIT_IDX_0, 0) \
	X_MACRO(FUNCINF_BIT_IDX_1, 1) \
	X_MACRO(FUNCINF_BIT_IDX_2, 2) \
	X_MACRO(FUNCINF_BIT_IDX_3, 3) \
	X_MACRO(FUNCINF_BIT_IDX_4, 4) \
	X_MACRO(FUNCINF_BIT_IDX_5, 5) \
	X_MACRO(FUNCINF_BIT_IDX_6, 6) \
	X_MACRO(FUNCINF_BIT_IDX_7, 7) \
	X_MACRO(FUNCINF_BIT_IDX_8, 8) \
	X_MACRO(FUNCINF_BIT_IDX_9, 9) \
	X_MACRO(FUNCINF_BIT_IDX_10, 10) \
	X_MACRO(FUNCINF_BIT_IDX_11, 11) \
	X_MACRO(FUNCINF_BIT_IDX_12, 12) \
	X_MACRO(FUNCINF_BIT_IDX_13, 13) \
	X_MACRO(FUNCINF_BIT_IDX_14, 14) \
	X_MACRO(FUNCINF_BIT_IDX_15, 15) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_BIT_IDX_TABLE
#undef X_MACRO  
} funcInfBitIdx_t;


#define FUNCINF_RUN_MODE_TABLE \
    X_MACRO(FUNCINF_RUN_MODE_PQ,  0x1111) \
    X_MACRO(FUNCINF_RUN_MODE_VF,  0x2222) \
    X_MACRO(FUNCINF_RUN_MODE_VSG, 0x3333) \
    X_MACRO(FUNCINF_RUN_MODE_VI,  0x4444) \
    X_MACRO(FUNCINF_RUN_MODE_CV,  0x5555) \
    X_MACRO(FUNCINF_RUN_MODE_CC,  0x6666) \
    X_MACRO(FUNCINF_RUN_MODE_CP,  0x7777) \
    X_MACRO(FUNCINF_RUN_MODE_OL,  0x8888) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_RUN_MODE_TABLE
#undef X_MACRO
} funcInfRunMode_t;


#define FUNCINF_FSM_TABLE \
	X_MACRO(FUNCINF_FSM_IDLE,    0) \
	X_MACRO(FUNCINF_FSM_CHARGE,  1) \
	X_MACRO(FUNCINF_FSM_EXCITE,  2) \
	X_MACRO(FUNCINF_FSM_PREWORK, 3) \
	X_MACRO(FUNCINF_FSM_WORKING, 4) \
	X_MACRO(FUNCINF_FSM_FAULT,   5) \
	X_MACRO(FUNCINF_FSM_STOP,    6) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_FSM_TABLE
#undef X_MACRO  
} fpagDataFsm_t;


#define FUNCINF_DEV_STATE_TABLE \
    X_MACRO(FUNCINF_DEV_STATE_SHUTDOWN, 0) \
    X_MACRO(FUNCINF_DEV_STATE_STANDBY,  1) \
    X_MACRO(FUNCINF_DEV_STATE_CHRGING,  2) \
    X_MACRO(FUNCINF_DEV_STATE_DISCING,  3) \
    X_MACRO(FUNCINF_DEV_STATE_FAULT,    4) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_DEV_STATE_TABLE
#undef X_MACRO  
} funcInfDevState_t;


#define FUNCINF_GRID_STATE_TABLE \
    X_MACRO(FUNCINF_GRID_STATE_OFF, 1) \
    X_MACRO(FUNCINF_GRID_STATE_ON,  2) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_GRID_STATE_TABLE
#undef X_MACRO  
} funcInfGridState_t;


#define FUNCINF_THRSHD_TYPE_TABLE \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_AC_OV,      0) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_AC_UV,      1) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_AC_OV_TIME, 2) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_AC_UV_TIME, 3) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_AC_OV,      4) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_AC_UV,      5) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_AC_OV_TIME, 6) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_AC_UV_TIME, 7) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_OF,         8) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_UF,         9) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_OF_TIME,    10) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L1_UF_TIME,    11) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_OF,         12) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_UF,         13) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_OF_TIME,    14) \
	X_MACRO(FUNCINF_THRSHD_TYPE_L2_UF_TIME,    15) \
	X_MACRO(FUNCINF_THRSHD_TYPE_AC_OV_INST,    16) \
	X_MACRO(FUNCINF_THRSHD_TYPE_AC_OC,         17) \
	X_MACRO(FUNCINF_THRSHD_TYPE_AC_OC_INST,    18) \
	X_MACRO(FUNCINF_THRSHD_TYPE_DC_OV,         19) \
	X_MACRO(FUNCINF_THRSHD_TYPE_DC_UV,         20) \
	X_MACRO(FUNCINF_THRSHD_TYPE_DC_OV_INST,    21) \
	X_MACRO(FUNCINF_THRSHD_TYPE_DC_OC,         22) \
	X_MACRO(FUNCINF_THRSHD_TYPE_DC_OC_INST,    23) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BAT_OV,        24) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BAT_UV,        25) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BAT_OV_INST,   26) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BAT_OC,        27) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BAT_OC_INST,   28) \
	X_MACRO(FUNCINF_THRSHD_TYPE_BUS_VOL_DIFF,  29) \
	X_MACRO(FUNCINF_THRSHD_TYPE_CUR_ZERO_BACK, 30) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_THRSHD_TYPE_TABLE
#undef X_MACRO  
} funcInfThrshdType_t;


#define FUNCINF_APPOINT_TYPE_TABLE \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC_VOL,      0) \
	X_MACRO(FUNCINF_APPOINT_TYPE_AC_VOL,      1) \
	X_MACRO(FUNCINF_APPOINT_TYPE_ACT_PWR,     2) \
	X_MACRO(FUNCINF_APPOINT_TYPE_REACT_PWR,   3) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC1_DC_VOL,  4) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC1_BAT_VOL, 5) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC1_BAT_CUR, 6) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC1_BAT_PWR, 7) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC2_DC_VOL,  8) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC2_BAT_VOL, 9) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC2_BAT_CUR, 10) \
	X_MACRO(FUNCINF_APPOINT_TYPE_DC2_BAT_PWR, 11) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_APPOINT_TYPE_TABLE
#undef X_MACRO  
} funcInfAppointType_t;


#define FUNCINF_LAMP_TABLE \
    X_MACRO(FUNCINF_LAMP_OFF, 0) \
    X_MACRO(FUNCINF_LAMP_ON,  1) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_LAMP_TABLE
#undef X_MACRO  
} funcInfLamp_t;


#define FUNCINF_TURN_TABLE \
    X_MACRO(FUNCINF_TURN_OFF, 0) \
    X_MACRO(FUNCINF_TURN_ON,  1) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_TURN_TABLE
#undef X_MACRO  
} funcInfTurn_t;


#define FUNCINF_IGBT_TEMP_TYPE_TABLE \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_A0,   0) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_A1,   1) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_B0,   2) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_B1,   3) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_C0,   4) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_C1,   5) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_AL23, 6) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_AL14, 7) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_AR23, 8) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_AR14, 9) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_BL23, 10) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_BL14, 11) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_BR23, 12) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_BR14, 13) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_CL23, 14) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_CL14, 15) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_CR23, 16) \
    X_MACRO(FUNCINF_IGBT_TEMP_TYPE_CR14, 17) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_IGBT_TEMP_TYPE_TABLE
#undef X_MACRO  
} funcInfIgbtTempType_t;


#define FUNCINF_ELEC_QUTT_TYPE_TABLE \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_AC_DISC_DAY, 0) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_AC_CHRG_DAY, 1) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_AC_DISC_TOT, 2) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_AC_CHRG_TOT, 3) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_DC_DISC_DAY, 4) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_DC_CHRG_DAY, 5) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_DC_DISC_TOT, 6) \
    X_MACRO(FUNCINF_ELEC_QUTT_TYPE_DC_CHRG_TOT, 7) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_ELEC_QUTT_TYPE_TABLE
#undef X_MACRO  
} funcInfElecQuttType_t;


#define FUNCINF_VER_TYPE_TABLE \
    X_MACRO(FUNCINF_VER_TYPE_V,   0) \
    X_MACRO(FUNCINF_VER_TYPE_C,   1) \
    X_MACRO(FUNCINF_VER_TYPE_B,   2) \
    X_MACRO(FUNCINF_VER_TYPE_R,   3) \
    X_MACRO(FUNCINF_VER_TYPE_ALL, 4) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_VER_TYPE_TABLE
#undef X_MACRO  
} funcInfVerType_t;


#define FUNCINF_RATIO_COEF_TYPE_TABLE \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_NULL,    0) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_AC_VOL,  1) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_AC_CUR,  2) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_AC_PWR,  3) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_DC_VOL,  4) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_DC_CUR,  5) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_DC_PWR,  6) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_BAT_VOL, 7) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_POS_VOL, 8) \
    X_MACRO(FUNCINF_RATIO_COEF_TYPE_NEG_VOL, 9) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_RATIO_COEF_TYPE_TABLE
#undef X_MACRO  
} funcInfRatioCoefType_t;


#define FUNCINF_NET_PARAM_TYPE_TABLE \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_IP0,  0) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_IP1,  1) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_IP2,  2) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_IP3,  3) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC0, 4) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC1, 5) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC2, 6) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC3, 7) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC4, 8) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT1_MAC5, 9) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_IP0,  10) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_IP1,  11) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_IP2,  12) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_IP3,  13) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC0, 14) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC1, 15) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC2, 16) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC3, 17) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC4, 18) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT2_MAC5, 19) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_IP0,  20) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_IP1,  21) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_IP2,  22) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_IP3,  23) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC0, 24) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC1, 25) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC2, 26) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC3, 27) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC4, 28) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT3_MAC5, 29) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_IP0,  30) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_IP1,  31) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_IP2,  32) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_IP3,  33) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC0, 34) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC1, 35) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC2, 36) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC3, 37) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC4, 38) \
    X_MACRO(FUNCINF_NET_PARAM_TYPE_PORT4_MAC5, 39) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_NET_PARAM_TYPE_TABLE
#undef X_MACRO  
} funcInfNetParamType_t;


#define FUNCINF_EXTR_VAL_TYPE_TABLE \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_AC_P_MAX, 0) \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_AC_Q_MAX, 1) \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_DC_P_MAX, 2) \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_DC_I_MAX, 3) \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_DC_U_MAX, 4) \
    X_MACRO(FUNCINF_EXTR_VAL_TYPE_DC_U_MIN, 5) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_EXTR_VAL_TYPE_TABLE
#undef X_MACRO  
} funcInfExtrValType_t;


#define FUNCINF_CTRL_MODE_TABLE \
    X_MACRO(FUNCINF_CTRL_MODE_LOCAL,  1) \
    X_MACRO(FUNCINF_CTRL_MODE_REMOTE, 2) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_CTRL_MODE_TABLE
#undef X_MACRO
} funcInfCtrlMode_t;


#define FUNCINF_TEST_SWITCH_TYPE_TABLE \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_ALONE_TEST, 0) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT1,       1) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT2,       2) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT3,       3) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT4,       4) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT5,       5) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT6,       6) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT7,       7) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT8,       8) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT9,       9) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT10,      10) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT11,      11) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT12,      12) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_BIT13,      13) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_FAN1,       14) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_FAN2,       15) \
    X_MACRO(FUNCINF_TEST_SWITCH_TYPE_ALL,        16) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_TEST_SWITCH_TYPE_TABLE
#undef X_MACRO  
} funcInfTestSwitchType_t;


#define FUNCINF_COMM_SWITCH_TYPE_TABLE \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_EMS,       0) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_LC,        1) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BMS,       2) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_DCDC,      3) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT4,      4) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT5,      5) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT6,      6) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT7,      7) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_HMI,       8) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_ISO_BOARD, 9) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_FAN1,      10) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_FAN2,      11) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_METER,     12) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT13,     13) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT14,     14) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_BIT15,     15) \
    X_MACRO(FUNCINF_COMM_SWITCH_TYPE_ALL,       16) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_COMM_SWITCH_TYPE_TABLE
#undef X_MACRO  
} funcInfCommSwitchType_t;


#define FUNCINF_STRTG_SWITCH_TYPE_TABLE \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_FAULT_REC,    0) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_SOFT_BOOTUP,  1) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_TIME_PERIOD,  2) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_ARM_3L_PRTCT, 3) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_1547,         4) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT5,         5) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT6,         6) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT7,         7) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT8,         8) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT9,         9) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT10,        10) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT11,        11) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT12,        12) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT13,        13) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT14,        14) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_BIT15,        15) \
    X_MACRO(FUNCINF_STRTG_SWITCH_TYPE_ALL,          16) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_STRTG_SWITCH_TYPE_TABLE
#undef X_MACRO  
} funcInfStrtgSwitchType_t;

#define FUNCINF_CONFIG_SWITCH_TYPE_TABLE \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_FAN_TYPE,    0) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT1,        1) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT2,        2) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT3,        3) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT4,        4) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT5,        5) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT6,        6) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT7,        7) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT8,        8) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT9,        9) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT10,       10) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT11,       11) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT12,       12) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT13,       13) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT14,       14) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_BIT15,       15) \
    X_MACRO(FUNCINF_CONFIG_SWITCH_TYPE_ALL,         16) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_CONFIG_SWITCH_TYPE_TABLE
#undef X_MACRO  
} funcInfConfigSwitchType_t;

#define FUNCINF_ARM_THR_TYPE_TABLE \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_OV_THR,       0) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_UV_THR,       1) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_OV_TIME,      2) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_UV_TIME,      3) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_OF_THR,       4) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_UF_THR,       5) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_OF_TIME,      6) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_3L_UF_TIME,      7) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_HIG_TEMP_DERATE, 8) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_TEMP_DIFF,       9) \
    X_MACRO(FUNCINF_ARM_THR_TYPE_LEAK_CUR,        10) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_ARM_THR_TYPE_TABLE
#undef X_MACRO  
} funcInfArmThrType_t;


#define FUNCINF_PERIOD_PARAM_TYPE_TABLE \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_1, 0) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_1,   1) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_1, 2) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_2, 3) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_2,   4) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_2, 5) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_3, 6) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_3,   7) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_3, 8) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_4, 9) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_4,   10) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_4, 11) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_5, 12) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_5,   13) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_5, 14) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_6, 15) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_6,   16) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_6, 17) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_7, 18) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_7,   19) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_7, 20) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_BEGIN_8, 21) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_END_8,   22) \
    X_MACRO(FUNCINF_PERIOD_PARAM_TYPE_POWER_8, 23) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_PERIOD_PARAM_TYPE_TABLE
#undef X_MACRO  
} funcInfPeriodParamType_t;


#define FUNCINF_1547_PARAM_TYPE_TABLE \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_Q_MODE_SEL, 0) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_MODE_EN, 1) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_MODE_EN, 2) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PL_MODE_EN, 3) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P3,      4) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q3,      5) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P2,      6) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q2,      7) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P1,      8) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q1,      9) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P1_N,    10) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q1_N,    11) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P2_N,    12) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q2_N,    13) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_P3_N,    14) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PQ_Q3_N,    15) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_UREF,    16) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_V2,      17) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_Q2,      18) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_V1,      19) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_Q1,      20) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_V3,      21) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_Q3,      22) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_V4,      23) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_Q4,      24) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VQ_TRESP,   25) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_CPF_PF,     26) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_V1,      27) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_P1,      28) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_V2,      29) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_P2,      30) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_VP_TRESP,   31) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_DBUF,    32) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_PVAL,    33) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_KUF,     34) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_DBOF,    35) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_PMIN,    36) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_KOF,     37) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_FP_TRESP,   38) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_PL_PMAX,    39) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OV_2L,      40) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OV_1L,      41) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UV_1L,      42) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UV_2L,      43) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OV_2L_TIME, 44) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OV_1L_TIME, 45) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UV_1L_TIME, 46) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UV_2L_TIME, 47) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OF_2L,      48) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OF_1L,      49) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UF_1L,      50) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UF_2L,      51) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OF_2L_TIME, 52) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_OF_1L_TIME, 53) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UF_1L_TIME, 54) \
    X_MACRO(FUNCINF_1547_PARAM_TYPE_UF_2L_TIME, 55) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_1547_PARAM_TYPE_TABLE
#undef X_MACRO  
} funcInf1547ParamType_t;


#define FUNCINF_DBG_VAL_IDX_TABLE \
    X_MACRO(FUNCINF_DBG_VAL_IDX_0,  0) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_1,  1) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_2,  2) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_3,  3) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_4,  4) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_5,  5) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_6,  6) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_7,  7) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_8,  8) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_9,  9) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_10, 10) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_11, 11) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_12, 12) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_13, 13) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_14, 14) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_15, 15) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_16, 16) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_17, 17) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_18, 18) \
    X_MACRO(FUNCINF_DBG_VAL_IDX_19, 19) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_DBG_VAL_IDX_TABLE
#undef X_MACRO  
} funcInfDbgValIdx_t;


#define FUNCINF_TIME_TYPE_TABLE \
    X_MACRO(FUNCINF_TIME_TYPE_YEAR, 0) \
    X_MACRO(FUNCINF_TIME_TYPE_MON,  1) \
    X_MACRO(FUNCINF_TIME_TYPE_DATE, 2) \
    X_MACRO(FUNCINF_TIME_TYPE_HOUR, 3) \
    X_MACRO(FUNCINF_TIME_TYPE_MIN,  4) \
    X_MACRO(FUNCINF_TIME_TYPE_SEC,  5) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_TIME_TYPE_TABLE
#undef X_MACRO  
} funcInfTimeType_t;


#define FUNCINF_ISO_BOARD_DATA_TYPE_TABLE \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_0,       0) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_REACT,   1) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_BUSCAP,  2) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_3,       3) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_TRANS,   4) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_ACCBNT,  5) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_FLTCAP2, 6) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_TEMP_FLTCAP1, 7) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_UA,           8) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_UB,           9) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_UC,           10) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_RES_POS,      11) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_RES_NEG,      12) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_IA,           13) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_IB,           14) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_IC,           15) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_LEAK,         16) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_VOL_POS,      17) \
    X_MACRO(FUNCINF_ISO_BOARD_DATA_TYPE_VOL_NEG,      18) \

typedef enum
{
#define X_MACRO(a, b) a = b,
    FUNCINF_ISO_BOARD_DATA_TYPE_TABLE
#undef X_MACRO  
} funcInfIsoBoardDataType_t;


#if 1
/**
 * @brief 直读FPGA
 */
funcInfErr_t FuncInf_DirectReadFpga(uint32_t addr, uint16_t *pValue);


/**
 * @brief 获取电压
 */
funcInfErr_t FuncInf_GetVoltage(funcInfVolType_t volType, float *pValue);


/**
 * @brief 获取电流
 */
funcInfErr_t FuncInf_GetCurrent(funcInfCurType_t curType, float *pValue);


/**
 * @brief 获取功率
 */
funcInfErr_t FuncInf_GetPower(funcInfPwrType_t pwrType, float *pValue);


/**
 * @brief 获取功率因数
 */
funcInfErr_t FuncInf_GetPowerFactor(void *pParam, float *pValue);


/**
 * @brief 获取频率
 */
funcInfErr_t FuncInf_GetFrequency(void *pParam, float *pValue);


/**
 * @brief 获取限制
 */
funcInfErr_t FuncInf_GetLimit(funcInfLmtType_t lmtType, float *pValue);


/**
 * @brief 获取系统状态寄存器
 */
funcInfErr_t FuncInf_GetStateRegister(funcInfRegIdx_t regIdx, uint16_t *pValue);


/**
 * @brief 获取系统故障寄存器
 */
funcInfErr_t FuncInf_GetFaultRegister(funcInfRegIdx_t regIdx, uint16_t *pValue);


/**
 * @brief 获取输入寄存器
 */
funcInfErr_t FuncInf_GetInputRegister(void *pParam, uint16_t *pValue);


/**
 * @brief 获取输出寄存器
 */
funcInfErr_t FuncInf_GetOutputRegister(void *pParam, uint16_t *pValue);


/**
 * @brief 获取FPGA状态机
 */
funcInfErr_t FuncInf_GetFsm(funcInfFsmType_t fsmType, fpagDataFsm_t *pValue);


/**
 * @brief 获取命令值
 */
funcInfErr_t FuncInf_GetCmd(funcInfCmdIdx_t cmdIdx, uint16_t *pValue);


/**
 * @brief 获取运行模式
 */
funcInfErr_t FuncInf_GetRunMode(void *pParam, funcInfRunMode_t *pValue);


/**
 * @brief 获取设备状态
 */
funcInfErr_t FuncInf_GetDevState(void *pParam, funcInfDevState_t *pValue);


/**
 * @brief 获取并离网状态
 */
funcInfErr_t FuncInf_GetGridState(void *pParam, funcInfGridState_t *pValue);


/**
 * @brief 获取保护阈值
 */
funcInfErr_t FuncInf_GetProtectThreshold(funcInfThrshdType_t thrshdType, float *pValue);


/**
 * @brief 获取给定值
 */
funcInfErr_t FuncInf_GetAppointValue(funcInfAppointType_t appointType, float *pValue);
#endif


#if 1
/**
 * @brief 直写FPGA
 */
funcInfErr_t FuncInf_DirectWriteFpga(funcInfOperator_t cmder, uint32_t addr, uint16_t value);


/**
 * @brief 设定限制
 */
funcInfErr_t FuncInf_SetLimit(funcInfOperator_t cmder, funcInfLmtType_t lmtType, float value);


/**
 * @brief 设定命令值
 */
funcInfErr_t FuncInf_SetCmd(funcInfOperator_t cmder, funcInfCmdIdx_t cmdIdx, uint16_t value);


/**
 * @brief 置位命令位
 */
funcInfErr_t FuncInf_SetCmdBit(funcInfOperator_t cmder, funcInfCmdIdx_t cmdIdx, funcInfBitIdx_t bitIdx);


/**
 * @brief 清除命令位
 */
funcInfErr_t FuncInf_ClearCmdBit(funcInfOperator_t cmder, funcInfCmdIdx_t cmdIdx, funcInfBitIdx_t bitIdx);


/**
 * @brief 设定运行模式
 */
funcInfErr_t FuncInf_SetRunMode(funcInfOperator_t cmder, void *pParam, funcInfRunMode_t value);


/**
 * @brief 设定保护阈值
 */
funcInfErr_t FuncInf_SetProtectThreshold(funcInfOperator_t cmder, funcInfThrshdType_t thrshdType, float value);


/**
 * @brief 设定给定值
 */
funcInfErr_t FuncInf_SetAppointValue(funcInfOperator_t cmder, funcInfAppointType_t appointType, float value);


/**
 * @brief 控制ARM故障灯
 */
funcInfErr_t FuncInf_CtrlArmFaultLamp(funcInfOperator_t cmder, void *pParam, funcInfLamp_t value);


/**
 * @brief 开关机
 */
funcInfErr_t FuncInf_TurnOnOff(funcInfOperator_t cmder, void *pParam, funcInfTurn_t value);
#endif


#if 1
/**
 * @brief 获取IGBT温度
 */
funcInfErr_t FuncInf_GetIgbtTemperature(funcInfIgbtTempType_t type, float *pValue);


/**
 * @brief 获取IGBT温度AD值
 */
funcInfErr_t FuncInf_GetIgbtTemperatureAd(funcInfIgbtTempType_t type, uint16_t *pValue);


/**
 * @brief 获取电量
 */
funcInfErr_t FuncInf_GetElectricQuantity(funcInfElecQuttType_t type, float *pValue);


/**
 * @brief 获取版本
 */
funcInfErr_t FuncInf_GetVersion(funcInfVerType_t type, uint16_t *pValue);


/**
 * @brief 获取变比系数
 */
funcInfErr_t FuncInf_GetRatioCoef(funcInfRatioCoefType_t type, float *pValue);


/**
 * @brief 获取网络参数
 */
funcInfErr_t FuncInf_GetNetParam(funcInfNetParamType_t type, uint16_t *pValue);


/**
 * @brief 获取HMI从机地址
 */
funcInfErr_t FuncInf_GetHmiSlaveId(void *pParam, uint16_t *pValue);


/**
 * @brief 获取最值
 */
funcInfErr_t FuncInf_GetExtremeValue(funcInfExtrValType_t type, float *pValue);


/**
 * @brief 获取控制模式
 */
funcInfErr_t FuncInf_GetCtrlMode(void *pParam, funcInfCtrlMode_t *pValue);


/**
 * @brief 获取模式
 */
funcInfErr_t FuncInf_GetMode(void *pParam, uint16_t *pValue);


/**
 * @brief 获取测试开关
 */
funcInfErr_t FuncInf_GetTestSwitch(funcInfTestSwitchType_t type, uint16_t *pValue);


/**
 * @brief 获取通讯开关
 */
funcInfErr_t FuncInf_GetCommunicateSwitch(funcInfCommSwitchType_t type, uint16_t *pValue);


/**
 * @brief 获取策略开关
 */
funcInfErr_t FuncInf_GetStrategySwitch(funcInfStrtgSwitchType_t type, uint16_t *pValue);


/**
 * @brief 获取配置开关
 */
funcInfErr_t FuncInf_GetConfigSwitch(funcInfConfigSwitchType_t type, uint16_t *pValue);


/**
 * @brief 获取ARM阈值
 */
funcInfErr_t FuncInf_GetArmThrshd(funcInfArmThrType_t type, float *pValue);


/**
 * @brief 获取功率爬坡率
 */
funcInfErr_t FuncInf_GetPwrSloped(void *pParam, float *pValue);


/**
 * @brief 获取时段参数
 */
funcInfErr_t FuncInf_GetPeriodParam(funcInfPeriodParamType_t type, float *pValue);


/**
 * @brief 获取1547参数
 */
funcInfErr_t FuncInf_Get1547Param(funcInf1547ParamType_t type, float *pValue);


/**
 * @brief 获取调试值
 */
funcInfErr_t FuncInf_GetDebugVal(funcInfDbgValIdx_t idx, float *pValue);


/**
 * @brief 获取时间
 */
funcInfErr_t FuncInf_GetTime(funcInfTimeType_t type, uint16_t *pValue);


/**
 * @brief 获取额定功率
 */
funcInfErr_t FuncInf_GetRatedPwr(void *pParam, float *pValue);


/**
 * @brief 获取绝缘板数据
 */
funcInfErr_t FuncInf_GetIsoBoardData(funcInfIsoBoardDataType_t type, float *pValue);


/**
 * @brief 获取心跳
 */
funcInfErr_t FuncInf_GetHeartbeat(void *pParam, uint16_t *pValue);
#endif


#if 1
/**
 * @brief 设置变比系数
 */
funcInfErr_t FuncInf_SetRatioCoef(funcInfOperator_t cmder, funcInfRatioCoefType_t type, float value);


/**
 * @brief 设置网络参数
 */
funcInfErr_t FuncInf_SetNetParam(funcInfOperator_t cmder, funcInfNetParamType_t type, uint16_t value);


/**
 * @brief 设置HMI从机地址
 */
funcInfErr_t FuncInf_SetHmiSlaveId(funcInfOperator_t cmder, void *pParam, uint16_t value);


/**
 * @brief 设置最值
 */
funcInfErr_t FuncInf_SetExtremeValue(funcInfOperator_t cmder, funcInfExtrValType_t type, float value);


/**
 * @brief 设置控制模式
 */
funcInfErr_t FuncInf_SetCtrlMode(funcInfOperator_t cmder, void *pParam, funcInfCtrlMode_t value);


/**
 * @brief 设置模式
 */
funcInfErr_t FuncInf_SetMode(funcInfOperator_t cmder, void *pParam, uint16_t value);


/**
 * @brief 设置测试开关
 */
funcInfErr_t FuncInf_SetTestSwitch(funcInfOperator_t cmder, funcInfTestSwitchType_t type, uint16_t value);


/**
 * @brief 设置通讯开关
 */
funcInfErr_t FuncInf_SetCommunicateSwitch(funcInfOperator_t cmder, funcInfCommSwitchType_t type, uint16_t value);


/**
 * @brief 设置策略开关
 */
funcInfErr_t FuncInf_SetStrategySwitch(funcInfOperator_t cmder, funcInfStrtgSwitchType_t type, uint16_t value);

/**
 * @brief 设置配置开关
 */
funcInfErr_t FuncInf_SetConfigSwitch(funcInfOperator_t cmder, funcInfConfigSwitchType_t type, uint16_t value);

/**
 * @brief 设置ARM阈值
 */
funcInfErr_t FuncInf_SetArmThrshd(funcInfOperator_t cmder, funcInfArmThrType_t type, float value);


/**
 * @brief 设置功率爬坡率
 */
funcInfErr_t FuncInf_SetPwrSloped(funcInfOperator_t cmder, void *pParam, float value);


/**
 * @brief 设置时段参数
 */
funcInfErr_t FuncInf_SetPeriodParam(funcInfOperator_t cmder, funcInfPeriodParamType_t type, float value);


/**
 * @brief 设置1547参数
 */
funcInfErr_t FuncInf_Set1547Param(funcInfOperator_t cmder, funcInf1547ParamType_t type, float value);


/**
 * @brief 设置调试值
 */
funcInfErr_t FuncInf_SetDebugVal(funcInfOperator_t cmder, funcInfDbgValIdx_t idx, float value);


/**
 * @brief 设置时间
 */
funcInfErr_t FuncInf_SetTime(funcInfOperator_t cmder, funcInfTimeType_t type, uint16_t value);


/**
 * @brief 重启
 */
funcInfErr_t FuncInf_Reboot(funcInfOperator_t cmder, void *pParam, void *pParam2);
#endif


#endif

